import mathjax3 from "markdown-it-mathjax3";

export default {
  title: "Mogan STEM",
  outDir: "../website",
  themeConfig: {
    search: {
      provider: "local",
    },
  },
  locales: {
    en: {
      label: "English",
      lang: "en",
      title: "Mogan STEM",
      description: "libre STEM suite for exploring science and technology",
      themeConfig: {
        siteTitle: "Mogan",
        logo: {
          src: "/mogan-logo.png",
          alt: "Mogan Logo",
        },
        nav: navEn(),
        sidebar: {
          "/en": sidebarEn(),
        },
        footer: {
          message: "Enjoy exploring science and technology!",
          copyright: "Copyright © 2022-2025 Mogan Contributors",
        },
      },
    },
    zh: {
      label: "简体中文",
      lang: "zh",
      title: "墨干理工套件",
      description: "用于探索科学与技术的自由的理工套件",
      themeConfig: {
        siteTitle: "墨干",
        logo: {
          src: "/mogan-logo.png",
          alt: "墨干Logo",
        },
        nav: navZh(),
        sidebar: {
          "/zh": sidebarZh(),
        },
        footer: {
          message: "享受探索科学与技术的乐趣！",
          copyright: "版权所有 © 2022-2025 墨干贡献者",
        },
      },
    },
  },
  lastUpdated: true,
  ignoreDeadLinks: false,
  head: [
    ["link", { rel: "icon", href: "/favicon.png" }],
  ],
  markdown: {
    config(md) {
      md.use(mathjax3);
    },
    externalLinks: {
      target: "_blank",
      rel: "",
    },
  },
};

function navEn() {
  return [
    {
      text: "",
      link: "/en/",
      activeMatch: "^/en/",
    },
    {
      text: "Guide",
      link: "/en/what-is-mogan",
    },
    {
      text: "Download",
      link: "/en/Install",
    },
    {
      text: "Features",
      items: [
        {
          text: "Python Plugin",
          link: "/en/plugin_python.md",
        },
        {
          text: "Maxima Plugin",
          link: "/en/plugin_maxima.md",
        },
        {
          text: "Goldfish Scheme",
          link: "/en/plugin_goldfish.md",
        },
      ],
    },
    {
      text: "Tutorials",
      items: [
        {
          text: "Official Documents",
          link: "/en/Official_Documents",
        },
        {
          text: "Mogan from Scratch🔥",
          link: "/en/Tutorial",
        },
        {
          text: "SICP Course",
          link: "/en/SICP",
        },
      ],
    },
    {
      text: "Community",
      items: [
        {
          text: "Forum",
          link: "http://forum.texmacs.cn",
        },
        {
          text: "Source Code",
          link: "/en/SourceCode",
        },
      ],
    },
    {
      text: "Related Projects",
      items: [
        {
          text: "Liii STEM",
          link: "https://liiistem.com/",
        },
        {
          text: "TeXmacs",
          link: "https://www.texmacs.org/tmweb/home/welcome.en.html",
        },
        {
          text: "Goldfish Scheme",
          link: "https://gitee.com/XmacsLabs/goldfish",
        },
      ],
    },
  ];
}

function navZh() {
  return [
    {
      text: "",
      link: "/zh/",
      activeMatch: "^/zh/",
    },
    {
      text: "指南",
      link: "/zh/what-is-mogan",
    },
    {
      text: "下载",
      link: "/zh/Install",
    },
    {
      text: "功能",
      items: [
        {
          text: "Python插件",
          link: "/zh/plugin_python.md",
        },
        {
          text: "Maxima插件",
          link: "/zh/plugin_maxima.md",
        },
        {
          text: "金鱼Scheme",
          link: "/zh/plugin_goldfish.md",
        },
      ],
    },
    {
      text: "教程",
      items: [
        {
          text: "官方文档",
          link: "/zh/Official_Documents",
        },
        {
          text: "零基础墨干🔥",
          link: "/zh/Tutorial",
        },
        {
          text: "SICP公开课",
          link: "/zh/SICP",
        },
      ],
    },
    {
      text: "社区",
      items: [
        {
          text: "论坛",
          link: "http://forum.texmacs.cn",
        },
        {
          text: "源代码",
          link: "/zh/SourceCode",
        },
      ],
    },
    {
      text: "相关项目",
      items: [
        {
          text: "Liii STEM",
          link: "https://liiistem.cn/",
        },
        {
          text: "TeXmacs",
          link: "https://www.texmacs.org/tmweb/home/welcome.en.html",
        },
        {
          text: "Goldfish Scheme",
          link: "https://gitee.com/XmacsLabs/goldfish",
        },
      ],
    },
  ];
}

function sidebarEn() {
  return [
    {
      text: "Getting Started",
      items: [
        { text: "What is Mogan STEM?", link: "/en/what-is-mogan" },
        { text: "Install", link: "/en/Install" },
        { text: "Examples", link: "/en/Examples" },
      ],
    },
    {
      text: "Tutorials",
      items: [
        { text: "Official Documents", link: "/en/Official_Documents" },
        { text: "Tutorial on Mogan", link: "/en/Tutorial" },
        { text: "SICP Course", link: "/en/SICP" },
      ],
    },
    {
      text: "Core Features",
      items: [
        { text: "Python Plugin", link: "/en/plugin_python.md" },
        { text: "Maxima Plugin", link: "/en/plugin_maxima.md" },
        { text: "Goldfish Scheme", link: "/en/plugin_goldfish.md" },
      ],
    },
    {
      text: "Data Exchange",
      items: [
        { text: "DOCX Data Plugin", link: "/en/plugin_data_docx.md" },
        { text: "PDF Data Plugin", link: "/en/plugin_data_pdf.md" },
      ],
    },
    {
      text: "Plugin System",
      collapsed: true,
      items: [
        { text: "Introduction to Plugins", link: "/en/plugins.md" },
        {
          text: "Aspell Binary plugin",
          link: "/en/plugin_binary_aspell.md",
        },
        { text: "Conda Binary plugin", link: "/en/plugin_binary_conda.md" },
        {
          text: "Ghostscript Binary plugin",
          link: "/en/plugin_binary_gs.md",
        },
        {
          text: "Hunspell Binary plugin",
          link: "/en/plugin_binary_hunspell.md",
        },
        {
          text: "Inkscape Binary plugin",
          link: "/en/plugin_binary_inkscape.md",
        },
        {
          text: "Pandoc Binary plugin",
          link: "/en/plugin_binary_pandoc.md",
        },
        {
          text: "Python3 Binary plugin",
          link: "/en/plugin_binary_python3.md",
        },
        {
          text: "rsvg-convert Binary plugin",
          link: "/en/plugin_binary_rsvg_convert.md",
        },
        { text: "PDF Image plugin", link: "/en/plugin_image_pdf.md" },
        { text: "SVG Image plugin", link: "/en/plugin_image_svg.md" },
      ],
    },
    {
      text: "Development",
      collapsed: true,
      items: [
        { text: "Contribution", link: "/en/Contribution.md" },
        { text: "Mogan vs TeXmacs", link: "/en/Development_Mogan_vs_TeXmacs.md" },
        { text: "Develop on Linux", link: "/en/Develop_on_Linux.md" },
        { text: "Develop on macOS", link: "/en/Develop_on_macOS.md" },
        { text: "Develop on Windows", link: "/en/Develop_on_Windows.md" },
        { text: "How to test", link: "/en/Test.md" },
      ],
    },
    {
      text: "Community",
      items: [
        { text: "Summer of Code", link: "/en/SummerOfCode.md" },
        { text: "Contact us", link: "/en/Contact" },
      ],
    },
    {
      text: "Releases",
      collapsed: true,
      items: [
        { text: "Releases", link: "/en/Releases.md" },
        { text: "v2025.1.4 (2025/10/06)", link: "/en/changelog/v2025.1.4.md" },
        { text: "v2025.1.1 (2025/08/21)", link: "/en/changelog/v2025.1.1.md" },
        { text: "v1.2.9.x LTS", link: "/en/changelog/v1.2.9.md" },
        { text: "v1.2.8 (2024/08/08)", link: "/en/changelog/v1.2.8.md" },
        { text: "v1.2.6 (2024/05/21)", link: "/en/changelog/v1.2.6.md" },
        { text: "v1.2.5.x LTS", link: "/en/ChangeLog/v1.2.5.md" },
        { text: "v1.2.4 (2024/02/01)", link: "/en/ChangeLog/v1.2.4.md" },
        { text: "v1.2.3 (2024/01/30)", link: "/en/ChangeLog/v1.2.3.md" },
        { text: "v1.2.2 (2023/12/23)", link: "/en/ChangeLog/v1.2.2.md" },
        { text: "v1.2.1 (2023/12/21)", link: "/en/ChangeLog/v1.2.1.md" },
        { text: "v1.2.0 (2023/12/03)", link: "/en/ChangeLog/v1.2.0.md" },
        { text: "v1.1.6 (2023/09/29)", link: "/en/changelog/v1.1.6.md" },
        { text: "v1.1.5 (2023/08/11)", link: "/en/changelog/v1.1.5.md" },
        { text: "v1.1.4 (2023/07/31)", link: "/en/changelog/v1.1.4.md" },
      ],
    },
  ];
}

function sidebarZh() {
  return [
    {
      text: "入门",
      items: [
        { text: "什么是墨干", link: "/zh/what-is-mogan" },
        { text: "如何安装？", link: "/zh/Install" },
        { text: "示例", link: "/zh/Examples" },
      ],
    },
    {
      text: "教程",
      items: [
        { text: "官方文档", link: "/zh/Official_Documents" },
        { text: "零基础墨干", link: "/zh/Tutorial" },
        { text: "SICP公开课", link: "/zh/SICP" },
      ],
    },
    {
      text: "核心功能",
      items: [
        { text: "Python插件", link: "/zh/plugin_python.md" },
        { text: "Maxima插件", link: "/zh/plugin_maxima.md" },
        { text: "金鱼Scheme", link: "/zh/plugin_goldfish.md" },
      ],
    },
    {
      text: "数据交换",
      items: [
        { text: "DOCX数据插件", link: "/zh/plugin_data_docx.md" },
        { text: "PDF数据插件", link: "/zh/plugin_data_pdf.md" },
      ],
    },
    {
      text: "插件体系",
      collapsed: true,
      items: [
        { text: "插件概述", link: "/zh/plugins.md" },
        { text: "Aspell二进制插件", link: "/zh/plugin_binary_aspell.md" },
        { text: "Conda二进制插件", link: "/zh/plugin_binary_conda.md" },
        {
          text: "Ghostscript二进制插件",
          link: "/zh/plugin_binary_gs.md",
        },
        {
          text: "Hunspell二进制插件",
          link: "/zh/plugin_binary_hunspell.md",
        },
        {
          text: "Inkscape二进制插件",
          link: "/zh/plugin_binary_inkscape.md",
        },
        {
          text: "Pandoc Binary plugin",
          link: "/zh/plugin_binary_pandoc.md",
        },
        {
          text: "Python3二进制插件",
          link: "/zh/plugin_binary_python3.md",
        },
        {
          text: "rsvg-convert二进制插件",
          link: "/zh/plugin_binary_rsvg_convert.md",
        },
        { text: "PDF图像插件", link: "/zh/plugin_image_pdf.md" },
        { text: "SVG图像插件", link: "/zh/plugin_image_svg.md" },
      ],
    },
    {
      text: "开发指南",
      collapsed: true,
      items: [
        { text: "如何贡献", link: "/zh/Contribution.md" },
        { text: "Mogan vs TeXmacs", link: "/zh/Development_Mogan_vs_TeXmacs.md" },
        { text: "Linux平台开发指南", link: "/zh/Develop_on_Linux.md" },
        { text: "macOS平台开发指南", link: "/zh/Develop_on_macOS.md" },
        {
          text: "Windows平台开发指南",
          link: "/zh/Develop_on_Windows.md",
        },
        { text: "如何测试", link: "/zh/Test.md" },
      ],
    },
    {
      text: "社区",
      items: [{ text: "联系我们", link: "/zh/Contact" }],
    },
    {
      text: "版本发布",
      collapsed: true,
      items: [
        { text: "版本发布", link: "/zh/Releases.md" },
        { text: "v2025.1.4 (2025/10/06)", link: "/zh/changelog/v2025.1.4.md" },
        { text: "v2025.1.1 (2025/08/21)", link: "/zh/changelog/v2025.1.1.md" },
        { text: "v1.2.9.x LTS", link: "/zh/changelog/v1.2.9.md" },
        { text: "v1.2.8 (2024/08/08)", link: "/zh/changelog/v1.2.8.md" },
        { text: "v1.2.6 (2024/05/21)", link: "/zh/changelog/v1.2.6.md" },
        { text: "v1.2.5.x LTS", link: "/zh/changelog/v1.2.5.md" },
        { text: "v1.2.4 (2024/02/01)", link: "/zh/changelog/v1.2.4.md" },
        { text: "v1.2.3 (2024/01/30)", link: "/zh/changelog/v1.2.3.md" },
        { text: "v1.2.2 (2023/12/23)", link: "/zh/changelog/v1.2.2.md" },
        { text: "v1.2.1 (2023/12/21)", link: "/zh/changelog/v1.2.1.md" },
        { text: "v1.2.0 (2023/12/03)", link: "/zh/changelog/v1.2.0.md" },
        { text: "v1.1.6 (2023/09/29)", link: "/zh/changelog/v1.1.6.md" },
        { text: "v1.1.5 (2023/08/11)", link: "/zh/changelog/v1.1.5.md" },
        { text: "v1.1.4 (2023/07/31)", link: "/zh/changelog/v1.1.4.md" },
        { text: "v1.1.3 (2023/06/05)", link: "/zh/changelog/v1.1.3.md" },
        { text: "v1.1.2 (2023/04/09)", link: "/zh/changelog/v1.1.2.md" },
        { text: "v1.1.1 (2022/10/31)", link: "/zh/changelog/v1.1.1.md" },
        { text: "v1.1.0 (2022/08/31)", link: "/zh/changelog/v1.1.0.md" },
        { text: "v1.0.4 (2022/05/28)", link: "/zh/changelog/v1.0.4.md" },
        { text: "v1.0.3 (2022/05/15)", link: "/zh/changelog/v1.0.3.md" },
        { text: "v1.0.2 (2022/05/04)", link: "/zh/changelog/v1.0.2.md" },
        { text: "v1.0.1 (2022/03/26)", link: "/zh/changelog/v1.0.1.md" },
        { text: "v1.0.0 (2022/01/31)", link: "/zh/changelog/v1.0.0.md" },
      ],
    },
  ];
}
